package com.jzo2o.customer.controller.agency;


import com.jzo2o.customer.model.domain.ServeProviderBank;
import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.service.IServeProviderBankService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("agencyBankController")
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端账户接口")
public class BankController {


    @Resource
    IServeProviderBankService bankService;

    @PostMapping()
    @ApiOperation("机构端新增或更新账户信息")
    public void saveOrUpdate(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        bankService.saveAccount(bankAccountUpsertReqDTO);
    }

    @GetMapping("/currentUserBankAccount")
    @ApiOperation("机构端获取账户信息")
    public ServeProviderBank getCurrentUserBankAccount() {
        return bankService.getAccount();
    }


}
